<!DOCTYPE html>
<html lang="zh-CN"><head>
    <meta charset="UTF-8">
    <title>{{title}}——在线商城</title>
    <link href="{{request.static_url('myproject:static/style/common.css')}}" rel="stylesheet">
    <link href="{{request.static_url('myproject:static/style/bootstrap.min.css')}}" rel="stylesheet">
        <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
    <script src="{{request.static_url('myproject:static/js/jquery-3.1.0.min.js')}}"></script>
    <script type="text/javascript" src="{{request.static_url('myproject:static/js/index.js')}}"></script>
        <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="{{request.static_url('myproject:static/js/bootstrap.min.js')}}"></script>
</head>
<body>
<input type="hidden" value="" name="user_id" id="session_user_id">
<header>
    <nav class="navbar navbar-default">
        <div class="container-fluid">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="{{request.route_url('home')}}">在线商城</a>
            </div>
            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav">
                    <li><a href="{{request.route_url('home')}}">首页<span class="sr-only">(current)</span></a></li>
                    {% if categories %}
                        {% for category_one in categories -%}
                            <li><a href="{{request.route_url('category',id=category_one.id)}}">{{category_one.name}}</a></li>
                        {%- endfor %}
                    {% endif %}
                </ul>
                <ul class="nav navbar-nav navbar-right">
                    {% if not request.user %}
                    <li><a href="{{request.route_url('login')}}">登录</a></li>
                    <li><a href="{{request.route_url('register')}}">注册</a></li>
                    {% else %}
                    <li><p class="navbar-text">欢迎 {{request.user.name}} 来到在线商城</p></li>
                     {% if category %}
                    {% if not category.children %}
                    <li><a href="{{request.route_url('add_item',id=category.id)}}">增加商品</a></li>
                    {% endif %}
                     {% endif %}
                    <li><a href="{{request.route_url('shoping_cart')}}">我的购物车</a></li>
                    <li><a href="{{request.route_url('order')}}">我的订单</a></li>
                    {% endif %}
                </ul>
            </div><!-- /.navbar-collapse -->
        </div><!-- /.container-fluid -->
    </nav>
    {% block breadcurmb %}
    <div class="container">
        <nav>
            <ol class="breadcrumb">
                <li><a href="{{request.route_url('home')}}">首页</a></li>
                <li class="active">{{title}}</li>
            </ol>
        </nav>
    </div>
    {% endblock %}
<!--strat top1-->
</header>
<!--header-->
{% block main %}
<h1 class="text-danger text-center">没有找到指定的页面</h1>
{% endblock %}
<!--footer-->
    <footer>
        <div class="container">
            <div class="row">
                <p>Copyright © 2016 </p>
            </div>
        </div>
    </footer>
<!--footer-->
</body></html>